package message

var (
	_ Event = new(EventImpl)
)

type Event interface {
	Message

	GetType() *Type
	GetSubCategory() string
}

type EventImpl struct {
	*MessageImpl

	AvoidKey string
	*Type
}

func (m *EventImpl) GetType() *Type {
	return m.Type
}

func (m *EventImpl) GetSubCategory() string {
	return ""
}

func (m *EventImpl) ImplName() string {
	return "EventImpl"
}

type Category string

const (
	LOCAL Category = "local"
	API   Category = "api"

	BINDING_KEY_PERFIX = "key.event."
)

type Type struct {
	name string
}

func NewType(ctg Category, subCtg string) *Type {
	return &Type{
		name: BINDING_KEY_PERFIX + string(ctg) + "." + subCtg,
	}
}

func (t Type) String() string {
	return t.name
}
